package service.backstage.impl;

import dao.backstage.GoodsDao;
import dao.backstage.impl.GoodsDaoImpl;
import pojo.Goods;
import service.backstage.updateGoodsService;

import java.math.BigDecimal;

public class updateGoodsServiceImpl implements updateGoodsService {
    GoodsDao goodsDao;
    public updateGoodsServiceImpl(){
        goodsDao = new GoodsDaoImpl();
    }

    @Override
    public int updateGoods(String goods_name, String picture, BigDecimal price, int type_id, String detail) {
        Goods goods = new Goods();
        goods.setGoods_name(goods_name);
        goods.setPicture(picture);
        goods.setPrice(price);
        goods.setType_id(type_id);
        goods.setDetail(detail);
        int i = goodsDao.updateGoods(goods);
        return i;
    }
}
